home *** CD-ROM | disk | FTP | other *** search
/ Focus for Success / Focus for Success.iso / pc / game2.dxr / 00089_Field_Script playbonus g2.txt < prev    next >
Text File  |  1995-02-28  |  3KB  |  93 lines

  1. on mouseUp
  2.   put "bonus" into theSoundName --we stick the actual sound name into "putSoundNameHere"
  3.   if the CommandKey is "down" then
  4.     answer "Are you sure you want to delete" && quote & theSoundName & quote & "?"├é --├å
  5.     with "No" or "Yes"  --├å
  6.     if it is "Yes" then --├å
  7.       set cursor to watch
  8.       deleteMe
  9.       exit mouseUp
  10.     end if
  11.     set the hilite of me to false
  12.   else
  13.     if ":Audio Help" & return is in the stacksInUse & return then --├å
  14.       if not SndExists(theSoundName) then
  15.         answer "The sound associated with this button has been deleted."&&├é --├å
  16.         " Would you like to delete the button as well?"├é --├å
  17.         with "No" or "Yes" --├å
  18.         if it is "Yes" then deleteMe --├å
  19.         set the hilite of me to false
  20.         exit mouseUp
  21.       end if
  22.     end if
  23.     play theSoundName
  24.     if the sound is not theSoundName then
  25.       answer "Sound" && quote & theSoundName & quote && "cannot be played." --├å
  26.       set the hilite of me to false
  27.       exit mouseUp
  28.     end if
  29.     repeat until the sound is done
  30.       if the mouse is down then play stop
  31.     end repeat
  32.     set the hilite of me to false
  33.   end if
  34. end mouseUp
  35.  
  36. on mouseDown
  37.   if the OptionKey is down then
  38.     repeat until the mouse is up
  39.       set the loc of me to the mouseloc
  40.     end repeat
  41.     get the rect of this card
  42.     if the loc of me is not within it then
  43.       put the height of this card div 2 into vert
  44.       put the width of this card div 2 into hor
  45.       set the loc of me to hor,vert
  46.     end if
  47.     exit to hypercard
  48.   else
  49.     put false into OldState
  50.     put true into NewState -- in case the click was really fast
  51.     repeat until the mouse is up
  52.       put the mouseLoc is within the rect of me into NewState
  53.       if NewState ┬¡ OldState then
  54.         set the hilite of me to NewState
  55.         put NewState into OldState
  56.       end if
  57.     end repeat
  58.     if not NewState then
  59.       set hilite of me to false
  60.       exit to hypercard
  61.     end if
  62.   end if
  63. end mouseDown
  64.  
  65. on deleteMe
  66.   global APHasEdit,APHasWaveEdit
  67.   put the short name of me into btnName
  68.   put the long name of this stack into stakName
  69.   delete the first word of btnName
  70.   delete the first word of stakName
  71.   delete the first char of stakName
  72.   delete the last char of stakName
  73.   lock screen
  74.   if APHasEdit is true then
  75.     if APHasWaveEdit is true then put "Clear" into menuItem 6 of menu 3  --├å
  76.     send "tempGiveUpEdit" to window "AudioPalette"
  77.   end if
  78.   get the userlevel
  79.   set the userlevel to 5
  80.   select me
  81.   send "doMenu Clear Button" to HyperCard
  82.   choose browse tool
  83.   set the userlevel to it
  84.   if APHasEdit is true then
  85.     if APHasWaveEdit is true then put "Clear Sound" into menuitem 6 of menu 3  --├å
  86.     send "tempTakeBackEdit" to window "AudioPalette"
  87.   end if
  88.   unlock screen
  89.   if ":Audio Help" & return is in the stacksInUse & return --├å
  90.   then deleteSnd stakName, btnName
  91.   if there is a window "AudioPalette" then send "update" to window "AudioPalette"
  92. end deleteMe
  93.